import itemForm from '@/components/form/index.vue';
import resetPassword from '@/components/form/reset-password.vue';
import blackPage from '@/views/black-page.vue';

export default {
  namespaced: true,
  state: {
    nowPage: 'restPassowrd',
    pageState: false,
    pages: {
      itemForm,
      resetPassword,
      blackPage,
    },
    animationBtnSetting: {
      button_1: { title: '暂定', component: 'blackPage' },
      button_2: { title: '暂定', component: 'blackPage' },
      button_3: { title: '暂定', component: 'blackPage' },
      button_4: { title: '暂定', component: 'blackPage' },
    },
  },
  mutations: {
    TOOGEL_PAGE: (state, data) => {
      state.nowPage = data;
    },
    TOOGEL_PAGE_STATE: (state) => {
      state.pageState = !state.pageState;
    },
  },
  actions: {
    toogelPage({ commit, state }, data) {
      commit('TOOGEL_PAGE', data || state.nowPage);
      commit('TOOGEL_PAGE_STATE');
    },
  },
};
